-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/save identity provider id #99
Conversation
現在登入成功的流程應該會走到 CustomSuccessHandler ...
val identityProviderId = authentication.principal.let { it as OidcUser }.subject
createUserUseCase.execute(CreateUserUseCase.Request(identityProviderId))
... |
When Creating an User The created User should look like this:
Issue #76 |
) | ||
private fun Jwt.toRequest(): CreateUserUseCase.Request = | ||
CreateUserUseCase.Request( | ||
this.subject ?: throw PlatformException("JWT subject is null") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
可以省略
override fun existsByIdentitiesIn(identityProviderId: String): Boolean = | ||
userDAO.existsByIdentitiesIn(mutableListOf(mutableListOf(identityProviderId))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q:想知道這裡為什麼需要兩層 List?
@@ -7,4 +7,5 @@ import tw.waterballsa.gaas.spring.repositories.data.UserData | |||
@Repository | |||
interface UserDAO : MongoRepository<UserData, String> { | |||
fun existsByEmail(email: String): Boolean | |||
fun existsByIdentitiesIn(identities: MutableCollection<MutableList<String>>): Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Q:想知道這裡為什麼需要兩層 List?
@@ -9,20 +9,23 @@ class UserData( | |||
@Id | |||
var id: String? = null, | |||
private var email: String? = null, | |||
var nickname: String? = null | |||
var nickname: String? = null, | |||
var identities: List<String> = emptyList() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q:這裡有特別的理由需要使用 var
宣告集合嗎?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
spring/src/main/kotlin/tw/waterballsa/gaas/spring/controllers/OAuth2Controller.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/SpringUserRepository.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/dao/UserDAO.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/data/UserData.kt
Outdated
Show resolved
Hide resolved
application/src/main/kotlin/tw/waterballsa/gaas/application/repositories/UserRepository.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
@Wally5077 @frankvicky |
08a271f
to
df6f0c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/configs/securities/CustomSuccessHandler.kt
Outdated
Show resolved
Hide resolved
df6f0c2
to
744fe74
Compare
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
744fe74
to
b1b970e
Compare
a7f2a08
to
75f2fa7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
功能部分 ok
code style 交給其他人
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/AbstractSpringBootTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
c996e83
to
fb8ccd6
Compare
fb8ccd6
to
9affdf0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/data/UserData.kt
Outdated
Show resolved
Hide resolved
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/data/UserData.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/AbstractSpringBootTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
spring/src/main/kotlin/tw/waterballsa/gaas/spring/repositories/data/UserData.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
application/src/main/kotlin/tw/waterballsa/gaas/application/usecases/CreateUserUseCase.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/AbstractSpringBootTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review done.
spring/src/test/kotlin/tw/waterballsa/gaas/spring/it/controllers/OAuth2ControllerTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why need this change? / Root cause:
Changes made:
Test Scope / Change impact:
Issue